Remove the OSTREE_MAX_RECURSION limit on metadata depth
authorBrian C. Lane <bcl@redhat.com>
Fri, 2 Jun 2017 15:30:43 +0000 (08:30 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 2 Jun 2017 16:18:28 +0000 (16:18 +0000)
This was making it impossible to pull or mirror a large ostree repo, and
according to Colin is no longer necessary. It works fine with a test
against a repo with 2741 commit and 451468 objects in it.

Closes: #899
Closes: #904
Approved by: jlebon

apidoc/ostree-sections.txt
src/libostree/ostree-core.h
src/libostree/ostree-repo-pull.c

index 56c5c94eb5acd797d42cad26097c6ac620d215e2..5e111a966a8921b192fda1d0249b92d00dc324d7 100644 (file)
@@ -89,7 +89,6 @@ OSTREE_VERSION_HEX
 <FILE>ostree-core</FILE>
 OSTREE_MAX_METADATA_SIZE
 OSTREE_MAX_METADATA_WARN_SIZE
-OSTREE_MAX_RECURSION
 OstreeObjectType
 OSTREE_OBJECT_TYPE_IS_META
 OSTREE_OBJECT_TYPE_LAST
index c530cea365d2ac4652756e352e78651bcebfe9c7..c1e014e2678c1416cef2218d46beb728c7c72a64 100644 (file)
@@ -44,13 +44,6 @@ G_BEGIN_DECLS
  */
 #define OSTREE_MAX_METADATA_WARN_SIZE (7 * 1024 * 1024)
 
-/**
- * OSTREE_MAX_RECURSION:
- * 
- * Maximum depth of metadata.
- */
-#define OSTREE_MAX_RECURSION (256)
-
 /**
  * OSTREE_SHA256_DIGEST_LEN:
  *
index 751129e63d6caf59bc15d03279e2a010e95b57ba..536ba58fbf22d2720a465f9712764e56b71da6fd 100644 (file)
@@ -152,7 +152,7 @@ typedef struct {
   guchar csum[OSTREE_SHA256_DIGEST_LEN];
   char *path;
   OstreeObjectType objtype;
-  guint recursion_depth;
+  guint recursion_depth; /* NB: not used anymore, though might be nice to print */
 } ScanObjectQueueData;
 
 static void start_fetch (OtPullData *pull_data, FetchObjectData *fetch);
@@ -564,9 +564,6 @@ scan_dirtree_object (OtPullData   *pull_data,
                      GCancellable *cancellable,
                      GError      **error)
 {
-  if (recursion_depth > OSTREE_MAX_RECURSION)
-    return glnx_throw (error, "Exceeded maximum recursion");
-
   g_autoptr(GVariant) tree = NULL;
   if (!ostree_repo_load_variant (pull_data->repo, OSTREE_OBJECT_TYPE_DIR_TREE, checksum,
                                  &tree, error))
@@ -1188,13 +1185,6 @@ scan_commit_object (OtPullData         *pull_data,
   gint depth;
   gboolean is_partial;
 
-  if (recursion_depth > OSTREE_MAX_RECURSION)
-    {
-      g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
-                   "Exceeded maximum recursion");
-      goto out;
-    }
-
   if (g_hash_table_lookup_extended (pull_data->commit_to_depth, checksum,
                                     NULL, &depthp))
     {